﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="GridPager.ascx.cs" Inherits="UserControl_GridPager" %>
<div class="rgPageContent">
    <table cellpadding="0" cellspacing="0" style="width: 100%;">
        <tr>
            <td style="width: 300px;">
                <div runat="server" id="uxChangePageIndex">
                    <gr:Literal runat="server" ID="uxChangePageText">Change Page: </gr:Literal>
                    <input type="button" onclick="return Pager_ChangePage(this,'first');" value="" class="rgPageFirst"
                        <%#(int)DataBinder.Eval(Container, "Paging.FirstIndexInPage") == (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex")? "disabled=\"true\"":""%> />
                    <input type="button" onclick="return Pager_ChangePage(this,'prev');" value="" class="rgPagePrev"
                        <%#(int)DataBinder.Eval(Container, "Paging.FirstIndexInPage") == (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex")? "disabled=\"true\"":""%> />
                    <input type="text" class="InputPager" style="width: 40px" onkeydown="return Pager_KeyPress(this,event);"
                        onchange="PageIndex_ValueChanged(this)" value='<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>'
                        <%#(int)DataBinder.Eval(Container, "Paging.FirstIndexInPage") == (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") && (int)DataBinder.Eval(Container, "Paging.PageCount")-1 == (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") ? "disabled=\"true\"":""%> />
                    <span>/<%# DataBinder.Eval(Container, "Paging.PageCount")%></span>
                    <input type="button" onclick="return Pager_ChangePage(this,'next');" value="" class="rgPageNext"
                        <%#(int)DataBinder.Eval(Container, "Paging.PageCount")-1 == (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") ? "disabled=\"true\"" : ""%> />
                    <input type="button" onclick="return Pager_ChangePage(this,'last');" value="" class="rgPageLast"
                        <%#(int)DataBinder.Eval(Container, "Paging.PageCount")-1 == (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") ? "disabled=\"true\"" : ""%> />
                </div>
            </td>
            <td style="width: auto; text-align: center;">
                <gr:Literal runat="server" ID="uxDisplayText"> Displaying Page</gr:Literal>
                <%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>
                <gr:Literal runat="server" ID="uxPageOfText">of</gr:Literal>
                <%# DataBinder.Eval(Container, "Paging.PageCount")%>.
                <gr:Literal runat="server" ID="uxRecordText">Records</gr:Literal>
                <%# (int)DataBinder.Eval(Container, "Paging.FirstIndexInPage") + 1 %>
                -
                <%# (int)DataBinder.Eval(Container, "Paging.LastIndexInPage") + 1 %>
                <gr:Literal runat="server" ID="uxRecordOfText">of</gr:Literal>
                <%# ((int)DataBinder.Eval(Container, "Paging.DataSourceCount")).ToString("###,###,###")%>.
            </td>
            <td style="width: 140px;" valign="middle">
                <div runat="server" id="uxChangePageSize">
                    <span style="padding-top:3px; display:inline-block"><gr:Literal runat="server" ID="uxPageSizeText"> Page size</gr:Literal></span>
                    <gr:GuruComboBox ID="uxPageSize" Width="60px" runat="server" Skin="WebBlue" EnableEmbeddedSkins="true"
                        OnClientSelectedIndexChanged="PageSize_SelectedIndexChanged" />
                </div>              
            </td>
        </tr>
    </table>
</div>
<gr:HiddenField ID="uxHddSourceCount" runat="server" Value='<%# DataBinder.Eval(Container,"Paging.DataSourceCount")%>' />
<gr:HiddenField ID="uxHddPagesize" runat="server" Value='<%# DataBinder.Eval(Container,"Paging.PageSize")%>' />
